//
//  ChoseMapStyleView.m
//  sdk2.0zhengquandasha
//
//  Created by Choi on 16/1/4.
//  Copyright © 2016年 palmaplus. All rights reserved.
//

#import "ChoseMapStyleView.h"
@interface ChoseMapStyleView()
@property (nonatomic,assign)CGSize size;
@end
@implementation ChoseMapStyleView



- (IBAction)touch2d:(UIButton *)sender {
    if (self.currentStyle == mapShowStyleNone) {
        [sender setBackgroundImage:[UIImage imageNamed:@"2d_pre"] forState:UIControlStateNormal];
        self.currentStyle = mapShowStyle2d;
    }else if (self.currentStyle == mapShowStyle2d){
    
    }else if (self.currentStyle == mapShowStyle3d){
        [self.btn3d setBackgroundImage:[UIImage imageNamed:@"3d"] forState:UIControlStateNormal];
        [sender setBackgroundImage:[UIImage imageNamed:@"2d_pre"] forState:UIControlStateNormal];
        self.currentStyle = mapShowStyle2d;
    }
        self.choseMapStyle(self.currentStyle,self.showCollect);
}

- (IBAction)touch3d:(UIButton *)sender {
    if (self.currentStyle == mapShowStyleNone) {
        [sender setBackgroundImage:[UIImage imageNamed:@"3d_pre"] forState:UIControlStateNormal];
        self.currentStyle = mapShowStyle3d;
    }else if (self.currentStyle == mapShowStyle3d){
        
    }else if (self.currentStyle == mapShowStyle2d){
        [self.btn2d setBackgroundImage:[UIImage imageNamed:@"2d"] forState:UIControlStateNormal];
        [sender setBackgroundImage:[UIImage imageNamed:@"3d_pre"] forState:UIControlStateNormal];
        self.currentStyle = mapShowStyle3d;
    }
    self.choseMapStyle(self.currentStyle,self.showCollect);
}
- (IBAction)touchCollect:(UIButton *)sender {
    if (self.showCollect) {
            [sender setBackgroundImage:[UIImage imageNamed:@"ico_off"] forState:UIControlStateNormal];
        self.showCollect = false;
    }else{
          [sender setBackgroundImage:[UIImage imageNamed:@"ico_on"] forState:UIControlStateNormal];
        self.showCollect = true;
    }
}
-(void)setShowCollect:(BOOL)showCollect{
    _showCollect = showCollect;
    if (showCollect) {
        [self.btnShowCollect setBackgroundImage:[UIImage imageNamed:@"ico_on"] forState:UIControlStateNormal];
    }else{
        [self.btnShowCollect setBackgroundImage:[UIImage imageNamed:@"ico_off"] forState:UIControlStateNormal];
    }
}

-(void)setCurrentStyle:(mapShowStyle)currentStyle{
    _currentStyle = currentStyle;
    if (currentStyle == mapShowStyle2d) {
        [self.btn2d setBackgroundImage:[UIImage imageNamed:@"2d_pre"] forState:UIControlStateNormal];
    }else{
        [self.btn3d setBackgroundImage:[UIImage imageNamed:@"3d_pre"] forState:UIControlStateNormal];
    }
}

-(void)removeFromSuperview{
//    if (self.choseMapStyle) {
//        self.choseMapStyle(self.currentStyle,self.showCollect);
//    }
    [super removeFromSuperview];
}
-(void)dealloc{

}




@end
